package com.itheima.entity;

import com.mysql.jdbc.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description 密码数据传输对象
 * @Author makun
 * @Date 2023/9/14 14:38
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PasswordDto {
    private String password;
    private String repeatPassword;

    /**
     * 判断密码是否相同
     * @return
     */
    public boolean isLegal() {
        if (!StringUtils.isNullOrEmpty(password) && !StringUtils.isNullOrEmpty(repeatPassword)) {
            return password.equals(repeatPassword);
        }
        return false;
    }
}
